home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / addflo / data1.cab / Program_Executable_Files / AddFlow / Samples / Demo / Itemprop.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-05-06  |  20.4 KB  |  609 lines

  1. VERSION 4.00
  2. Begin VB.Form frmItemProp 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Properties"
  5.    ClientHeight    =   6210
  6.    ClientLeft      =   1560
  7.    ClientTop       =   405
  8.    ClientWidth     =   6210
  9.    Height          =   6615
  10.    Left            =   1500
  11.    LinkTopic       =   "Form2"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   6210
  15.    ScaleWidth      =   6210
  16.    ShowInTaskbar   =   0   'False
  17.    Top             =   60
  18.    Width           =   6330
  19.    Begin VB.OptionButton OptionFont 
  20.       Caption         =   "Font MS Serif Italic"
  21.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  22.          Name            =   "MS Serif"
  23.          Size            =   8.25
  24.          Charset         =   0
  25.          Weight          =   400
  26.          Underline       =   0   'False
  27.          Italic          =   -1  'True
  28.          Strikethrough   =   0   'False
  29.       EndProperty
  30.       Height          =   285
  31.       Index           =   2
  32.       Left            =   150
  33.       TabIndex        =   40
  34.       Top             =   5880
  35.       Width           =   3045
  36.    End
  37.    Begin VB.OptionButton OptionFont 
  38.       Caption         =   "Font Courier 10 Underline"
  39.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  40.          Name            =   "Courier New"
  41.          Size            =   8.25
  42.          Charset         =   0
  43.          Weight          =   400
  44.          Underline       =   -1  'True
  45.          Italic          =   0   'False
  46.          Strikethrough   =   0   'False
  47.       EndProperty
  48.       Height          =   285
  49.       Index           =   1
  50.       Left            =   150
  51.       TabIndex        =   39
  52.       Top             =   5580
  53.       Width           =   3045
  54.    End
  55.    Begin VB.OptionButton OptionFont 
  56.       Caption         =   "Font Arial 8 Normal "
  57.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  58.          Name            =   "Arial"
  59.          Size            =   8.25
  60.          Charset         =   0
  61.          Weight          =   400
  62.          Underline       =   0   'False
  63.          Italic          =   0   'False
  64.          Strikethrough   =   0   'False
  65.       EndProperty
  66.       Height          =   285
  67.       Index           =   0
  68.       Left            =   150
  69.       TabIndex        =   38
  70.       Top             =   5310
  71.       Width           =   2505
  72.    End
  73.    Begin VB.CheckBox CheckRigid 
  74.       Alignment       =   1  'Right Justify
  75.       Caption         =   "Rigid link"
  76.       Height          =   255
  77.       Left            =   4350
  78.       TabIndex        =   37
  79.       Top             =   3240
  80.       Width           =   1635
  81.    End
  82.    Begin VB.Frame FrameNodePicture 
  83.       Caption         =   "Node picture"
  84.       Height          =   1425
  85.       Left            =   4350
  86.       TabIndex        =   32
  87.       Top             =   1140
  88.       Width           =   1665
  89.       Begin VB.OptionButton OptionPicture 
  90.          Caption         =   "None"
  91.          Height          =   270
  92.          Index           =   0
  93.          Left            =   120
  94.          TabIndex        =   36
  95.          Top             =   210
  96.          Width           =   1395
  97.       End
  98.       Begin VB.OptionButton OptionPicture 
  99.          Caption         =   "Server"
  100.          Height          =   270
  101.          Index           =   3
  102.          Left            =   120
  103.          TabIndex        =   35
  104.          Top             =   1080
  105.          Width           =   1395
  106.       End
  107.       Begin VB.OptionButton OptionPicture 
  108.          Caption         =   "MAC client"
  109.          Height          =   270
  110.          Index           =   2
  111.          Left            =   120
  112.          TabIndex        =   34
  113.          Top             =   810
  114.          Width           =   1395
  115.       End
  116.       Begin VB.OptionButton OptionPicture 
  117.          Caption         =   "PC client"
  118.          Height          =   270
  119.          Index           =   1
  120.          Left            =   120
  121.          TabIndex        =   33
  122.          Top             =   510
  123.          Width           =   1395
  124.       End
  125.    End
  126.    Begin VB.ComboBox ComboArrowOrg 
  127.       Height          =   315
  128.       ItemData        =   "Itemprop.frx":0000
  129.       Left            =   1530
  130.       List            =   "Itemprop.frx":001F
  131.       Style           =   2  'Dropdown List
  132.       TabIndex        =   28
  133.       Top             =   1860
  134.       Width           =   2415
  135.    End
  136.    Begin VB.ComboBox ComboArrowDst 
  137.       Height          =   315
  138.       ItemData        =   "Itemprop.frx":00CD
  139.       Left            =   1530
  140.       List            =   "Itemprop.frx":00EC
  141.       Style           =   2  'Dropdown List
  142.       TabIndex        =   27
  143.       Top             =   2220
  144.       Width           =   2415
  145.    End
  146.    Begin VB.ComboBox ComboLinkStyle 
  147.       Height          =   315
  148.       ItemData        =   "Itemprop.frx":019A
  149.       Left            =   1530
  150.       List            =   "Itemprop.frx":01A4
  151.       Style           =   2  'Dropdown List
  152.       TabIndex        =   26
  153.       Top             =   2580
  154.       Width           =   2415
  155.    End
  156.    Begin VB.TextBox TextDrawWidth 
  157.       Height          =   315
  158.       Left            =   1530
  159.       TabIndex        =   3
  160.       Top             =   3330
  161.       Width           =   525
  162.    End
  163.    Begin VB.Frame FrameUserData 
  164.       Caption         =   "User Data"
  165.       Height          =   2055
  166.       Left            =   3030
  167.       TabIndex        =   17
  168.       Top             =   3480
  169.       Width           =   3015
  170.       Begin VB.TextBox Text3 
  171.          Height          =   285
  172.          Left            =   1080
  173.          TabIndex        =   11
  174.          Top             =   1650
  175.          Width           =   1065
  176.       End
  177.       Begin VB.TextBox Text1 
  178.          Height          =   555
  179.          Left            =   570
  180.          MultiLine       =   -1  'True
  181.          ScrollBars      =   2  'Vertical
  182.          TabIndex        =   9
  183.          Top             =   300
  184.          Width           =   2325
  185.       End
  186.       Begin VB.TextBox Text2 
  187.          Height          =   555
  188.          Left            =   570
  189.          MultiLine       =   -1  'True
  190.          ScrollBars      =   2  'Vertical
  191.          TabIndex        =   10
  192.          Top             =   960
  193.          Width           =   2325
  194.       End
  195.       Begin VB.Label Label8 
  196.          Alignment       =   1  'Right Justify
  197.          AutoSize        =   -1  'True
  198.          Caption         =   "User Data:"
  199.          Height          =   195
  200.          Left            =   180
  201.          TabIndex        =   24
  202.          Top             =   1680
  203.          Width           =   765
  204.       End
  205.       Begin VB.Label Label1 
  206.          Alignment       =   1  'Right Justify
  207.          AutoSize        =   -1  'True
  208.          Caption         =   "Text:"
  209.          Height          =   195
  210.          Left            =   105
  211.          TabIndex        =   23
  212.          Top             =   300
  213.          Width           =   360
  214.       End
  215.       Begin VB.Label Label6 
  216.          Alignment       =   1  'Right Justify
  217.          AutoSize        =   -1  'True
  218.          Caption         =   "Tag:"
  219.          Height          =   195
  220.          Left            =   135
  221.          TabIndex        =   18
  222.          Top             =   990
  223.          Width           =   330
  224.       End
  225.    End
  226.    Begin VB.CommandButton CommandForeColor 
  227.       Caption         =   "Fore Color..."
  228.       Height          =   375
  229.       Left            =   180
  230.       TabIndex        =   6
  231.       Top             =   4740
  232.       Width           =   1305
  233.    End
  234.    Begin VB.CommandButton CommandDrawColor 
  235.       Caption         =   "Draw Color..."
  236.       Height          =   375
  237.       Left            =   180
  238.       TabIndex        =   5
  239.       Top             =   4320
  240.       Width           =   1305
  241.    End
  242.    Begin VB.CommandButton CommandFillColor 
  243.       Caption         =   "Fill Color..."
  244.       Height          =   375
  245.       Left            =   180
  246.       TabIndex        =   4
  247.       Top             =   3900
  248.       Width           =   1305
  249.    End
  250.    Begin VB.ComboBox ComboDrawStyle 
  251.       Height          =   315
  252.       ItemData        =   "Itemprop.frx":01C2
  253.       Left            =   1530
  254.       List            =   "Itemprop.frx":01DB
  255.       Style           =   2  'Dropdown List
  256.       TabIndex        =   2
  257.       Top             =   2970
  258.       Width           =   2415
  259.    End
  260.    Begin VB.CheckBox CheckHiding 
  261.       Alignment       =   1  'Right Justify
  262.       Caption         =   "Hidden Item"
  263.       Height          =   255
  264.       Left            =   4350
  265.       TabIndex        =   8
  266.       Top             =   2940
  267.       Width           =   1635
  268.    End
  269.    Begin VB.CheckBox CheckTransparent 
  270.       Alignment       =   1  'Right Justify
  271.       Caption         =   "Node Transparent"
  272.       Height          =   255
  273.       Left            =   4350
  274.       TabIndex        =   7
  275.       Top             =   2640
  276.       Width           =   1635
  277.    End
  278.    Begin VB.ComboBox ComboAlignment 
  279.       Height          =   315
  280.       ItemData        =   "Itemprop.frx":0241
  281.       Left            =   1530
  282.       List            =   "Itemprop.frx":0260
  283.       Style           =   2  'Dropdown List
  284.       TabIndex        =   1
  285.       Top             =   1500
  286.       Width           =   2415
  287.    End
  288.    Begin VB.CommandButton Command2 
  289.       Cancel          =   -1  'True
  290.       Caption         =   "Cancel"
  291.       Height          =   435
  292.       Left            =   5280
  293.       TabIndex        =   13
  294.       Top             =   660
  295.       Width           =   750
  296.    End
  297.    Begin VB.CommandButton Command1 
  298.       Caption         =   "Ok"
  299.       Default         =   -1  'True
  300.       Height          =   435
  301.       Left            =   5280
  302.       TabIndex        =   12
  303.       Top             =   180
  304.       Width           =   750
  305.    End
  306.    Begin VB.ComboBox ComboShape 
  307.       Height          =   315
  308.       ItemData        =   "Itemprop.frx":033F
  309.       Left            =   1530
  310.       List            =   "Itemprop.frx":035E
  311.       Style           =   2  'Dropdown List
  312.       TabIndex        =   0
  313.       Top             =   1140
  314.       Width           =   2415
  315.    End
  316.    Begin VB.Label Label4 
  317.       AutoSize        =   -1  'True
  318.       Caption         =   "Origin Arrow:"
  319.       Height          =   195
  320.       Left            =   180
  321.       TabIndex        =   31
  322.       Top             =   1890
  323.       Width           =   900
  324.    End
  325.    Begin VB.Label Label7 
  326.       AutoSize        =   -1  'True
  327.       Caption         =   "Destination arrow:"
  328.       Height          =   195
  329.       Left            =   180
  330.       TabIndex        =   30
  331.       Top             =   2250
  332.       Width           =   1275
  333.    End
  334.    Begin VB.Label Label10 
  335.       AutoSize        =   -1  'True
  336.       Caption         =   "Link line style:"
  337.       Height          =   195
  338.       Left            =   180
  339.       TabIndex        =   29
  340.       Top             =   2610
  341.       Width           =   990
  342.    End
  343.    Begin VB.Label Label9 
  344.       AutoSize        =   -1  'True
  345.       Caption         =   "DrawWidth:"
  346.       Height          =   195
  347.       Left            =   180
  348.       TabIndex        =   25
  349.       Top             =   3360
  350.       Width           =   840
  351.    End
  352.    Begin VB.Label LabelComment 
  353.       BorderStyle     =   1  'Fixed Single
  354.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  355.          Name            =   "MS Sans Serif"
  356.          Size            =   8.25
  357.          Charset         =   0
  358.          Weight          =   700
  359.          Underline       =   0   'False
  360.          Italic          =   0   'False
  361.          Strikethrough   =   0   'False
  362.       EndProperty
  363.       Height          =   795
  364.       Left            =   180
  365.       TabIndex        =   22
  366.       Top             =   180
  367.       Width           =   3765
  368.    End
  369.    Begin VB.Label LabelForeColor 
  370.       BorderStyle     =   1  'Fixed Single
  371.       Height          =   345
  372.       Left            =   1590
  373.       TabIndex        =   21
  374.       Top             =   4740
  375.       Width           =   345
  376.    End
  377.    Begin VB.Label LabelDrawColor 
  378.       BorderStyle     =   1  'Fixed Single
  379.       Height          =   345
  380.       Left            =   1590
  381.       TabIndex        =   20
  382.       Top             =   4320
  383.       Width           =   345
  384.    End
  385.    Begin VB.Label LabelFillColor 
  386.       BorderStyle     =   1  'Fixed Single
  387.       Height          =   345
  388.       Left            =   1590
  389.       TabIndex        =   19
  390.       Top             =   3900
  391.       Width           =   345
  392.    End
  393.    Begin VB.Label Label5 
  394.       AutoSize        =   -1  'True
  395.       Caption         =   "DrawStyle:"
  396.       Height          =   195
  397.       Left            =   180
  398.       TabIndex        =   16
  399.       Top             =   3000
  400.       Width           =   765
  401.    End
  402.    Begin VB.Label Label3 
  403.       AutoSize        =   -1  'True
  404.       Caption         =   "Text Alignment:"
  405.       Height          =   195
  406.       Left            =   180
  407.       TabIndex        =   15
  408.       Top             =   1530
  409.       Width           =   1095
  410.    End
  411.    Begin VB.Label Label2 
  412.       AutoSize        =   -1  'True
  413.       Caption         =   "Node Shape:"
  414.       Height          =   195
  415.       Left            =   180
  416.       TabIndex        =   14
  417.       Top             =   1170
  418.       Width           =   945
  419.    End
  420. Attribute VB_Name = "frmItemProp"
  421. Attribute VB_Creatable = False
  422. Attribute VB_Exposed = False
  423. Option Explicit
  424. Dim PicNum%
  425. Dim FontNum%
  426. Private Sub Command1_Click()
  427.   With frmMain.ActiveForm.AddFlow1
  428.     If .SelectedNode Is Nothing And .SelectedLink Is Nothing Then
  429.       ' No current item
  430.       .FillColor = LabelFillColor.BackColor
  431.       .ForeColor = LabelForeColor.BackColor
  432.       .DrawColor = LabelDrawColor.BackColor
  433.       Set .Font = OptionFont(FontNum).Font
  434.       .DrawStyle = ComboDrawStyle.ListIndex
  435.       .DrawWidth = Val(TextDrawWidth)
  436.       .ArrowDst = ComboArrowDst.ListIndex
  437.       .ArrowOrg = ComboArrowOrg.ListIndex
  438.       .LinkStyle = ComboLinkStyle.ListIndex
  439.       .Hidden = (CheckHiding.Value = 1)
  440.       .Transparent = (CheckTransparent.Value = 1)
  441.       .Shape = ComboShape.ListIndex
  442.       .Alignment = ComboAlignment.ListIndex
  443.     ElseIf .SelectedLink Is Nothing Then
  444.       ' Current node
  445.       .SelectedNode.DrawColor = LabelDrawColor.BackColor
  446.       .SelectedNode.ForeColor = LabelForeColor.BackColor
  447.       .SelectedNode.Text = Text1
  448.       .SelectedNode.Tag = Text2
  449.       .SelectedNode.UserData = Val(Text3)
  450.       .SelectedNode.DrawStyle = ComboDrawStyle.ListIndex
  451.       .SelectedNode.DrawWidth = Val(TextDrawWidth)
  452.       .SelectedNode.Hidden = (CheckHiding.Value = 1)
  453.       Set .SelectedNode.Font = OptionFont(FontNum).Font
  454.       .SelectedNode.Transparent = (CheckTransparent.Value = 1)
  455.       .SelectedNode.Shape = ComboShape.ListIndex
  456.       .SelectedNode.Alignment = ComboAlignment.ListIndex
  457.       .SelectedNode.FillColor = LabelFillColor.BackColor
  458.       If PicNum = 0 Then
  459.         Set .SelectedNode.Picture = Nothing
  460.       Else
  461.         Set .SelectedNode.Picture = frmMain.ActiveForm.Picture1(PicNum).Picture
  462.       End If
  463.     Else
  464.       .SelectedLink.DrawColor = LabelDrawColor.BackColor
  465.       .SelectedLink.ForeColor = LabelForeColor.BackColor
  466.       .SelectedLink.Text = Text1
  467.       .SelectedLink.Tag = Text2
  468.       .SelectedLink.UserData = Val(Text3)
  469.       .SelectedLink.DrawStyle = ComboDrawStyle.ListIndex
  470.       .SelectedLink.LinkStyle = ComboLinkStyle.ListIndex
  471.       .SelectedLink.DrawWidth = Val(TextDrawWidth)
  472.       .SelectedLink.Hidden = (CheckHiding.Value = 1)
  473.       .SelectedLink.Rigid = (CheckRigid.Value = 1)
  474.       Set .SelectedLink.Font = OptionFont(FontNum).Font
  475.       .SelectedLink.ArrowDst = ComboArrowDst.ListIndex
  476.       .SelectedLink.ArrowOrg = ComboArrowOrg.ListIndex
  477.     End If
  478.   End With
  479.   Unload Me
  480. End Sub
  481. Private Sub Command2_Click()
  482.   Unload Me
  483. End Sub
  484. Private Sub CommandDrawColor_Click()
  485.   LabelDrawColor.BackColor = frmColors.SelectColor(LabelDrawColor.BackColor)
  486. End Sub
  487. Private Sub CommandFillColor_Click()
  488.   LabelFillColor.BackColor = frmColors.SelectColor(LabelFillColor.BackColor)
  489. End Sub
  490. Private Sub CommandForeColor_Click()
  491.   LabelForeColor.BackColor = frmColors.SelectColor(LabelForeColor.BackColor)
  492. End Sub
  493. Private Sub Form_Load()
  494.   Dim f As Font
  495.   With frmMain.ActiveForm.AddFlow1
  496.     If .SelectedNode Is Nothing And .SelectedLink Is Nothing Then
  497.       FrameUserData.Visible = False
  498.       LabelComment.Caption = "No current item: therefore property settings are persistent. Next created items will received those property values by default."
  499.       Text1.Enabled = False
  500.       Text2.Enabled = False
  501.       Text3.Enabled = False
  502.       CheckRigid.Enabled = False
  503.       ComboArrowDst.ListIndex = .ArrowDst
  504.       ComboArrowOrg.ListIndex = .ArrowOrg
  505.       ComboLinkStyle.ListIndex = .LinkStyle
  506.       If .Transparent Then
  507.         CheckTransparent.Value = 1
  508.       Else
  509.         CheckTransparent.Value = 0
  510.       End If
  511.       ComboShape.ListIndex = .Shape
  512.       ComboAlignment.ListIndex = .Alignment
  513.       LabelFillColor.BackColor = .FillColor
  514.       If .Hidden Then
  515.         CheckHiding.Value = 1
  516.       Else
  517.         CheckHiding.Value = 0
  518.       End If
  519.       ComboDrawStyle.ListIndex = .DrawStyle
  520.       LabelDrawColor.BackColor = .DrawColor
  521.       LabelForeColor.BackColor = .ForeColor
  522.       TextDrawWidth = Str(.DrawWidth)
  523.       Set f = .Font
  524.     ElseIf .SelectedNode Is Nothing Then
  525.       ' Selected link
  526.       LabelComment.Caption = "The current item is a link. ""Node-only"" properties are disabled. Property settings will apply only to this current link."
  527.       Text1 = .SelectedLink.Text
  528.       Text2 = .SelectedLink.Tag
  529.       Text3 = Str(.SelectedLink.UserData)
  530.       ComboDrawStyle.ListIndex = .SelectedLink.DrawStyle
  531.       TextDrawWidth = Str(.SelectedLink.DrawWidth)
  532.       LabelDrawColor.BackColor = .SelectedLink.DrawColor
  533.       LabelForeColor.BackColor = .SelectedLink.ForeColor
  534.       If .SelectedLink.Hidden Then
  535.         CheckHiding.Value = 1
  536.       Else
  537.         CheckHiding.Value = 0
  538.       End If
  539.       If .SelectedLink.Rigid Then
  540.         CheckRigid.Value = 1
  541.       Else
  542.         CheckRigid.Value = 0
  543.       End If
  544.       ComboShape.Enabled = False
  545.       ComboAlignment.Enabled = False
  546.       ComboArrowDst.ListIndex = .SelectedLink.ArrowDst
  547.       ComboArrowOrg.ListIndex = .SelectedLink.ArrowOrg
  548.       ComboLinkStyle.ListIndex = .SelectedLink.LinkStyle
  549.       CommandFillColor.Enabled = False
  550.       CheckTransparent.Enabled = False
  551.       Set f = .SelectedLink.Font
  552.     Else
  553.       LabelComment.Caption = "The current item is a node. ""Link-only"" properties are disabled. Property settings will apply only to this current node."
  554.       Text1 = .SelectedNode.Text
  555.       Text2 = .SelectedNode.Tag
  556.       Text3 = Str(.SelectedNode.UserData)
  557.       ComboDrawStyle.ListIndex = .SelectedNode.DrawStyle
  558.       TextDrawWidth = Str(.SelectedNode.DrawWidth)
  559.       LabelDrawColor.BackColor = .SelectedNode.DrawColor
  560.       LabelForeColor.BackColor = .SelectedNode.ForeColor
  561.       If .SelectedNode.Hidden Then
  562.         CheckHiding.Value = 1
  563.       Else
  564.         CheckHiding.Value = 0
  565.       End If
  566.       If .SelectedNode.Transparent Then
  567.         CheckTransparent.Value = 1
  568.       Else
  569.         CheckTransparent.Value = 0
  570.       End If
  571.       ComboLinkStyle.Enabled = False
  572.       ComboArrowOrg.Enabled = False
  573.       ComboArrowDst.Enabled = False
  574.       ComboShape.ListIndex = .SelectedNode.Shape
  575.       ComboAlignment.ListIndex = .SelectedNode.Alignment
  576.       LabelFillColor.BackColor = .SelectedNode.FillColor
  577.       Set f = .SelectedNode.Font
  578.       
  579.       ' Setting node picture
  580.       If .SelectedNode.Picture Is Nothing Then
  581.         OptionPicture(0) = True
  582.       ElseIf .SelectedNode.Picture = frmMain.ActiveForm.Picture1(1).Picture Then
  583.         OptionPicture(1) = True
  584.       ElseIf .SelectedNode.Picture = frmMain.ActiveForm.Picture1(2).Picture Then
  585.         OptionPicture(2) = True
  586.       ElseIf .SelectedNode.Picture = frmMain.ActiveForm.Picture1(3).Picture Then
  587.         OptionPicture(3) = True
  588.       End If
  589.       
  590.       CheckRigid.Enabled = False
  591.     End If
  592.       
  593.     ' Item Font
  594.     If f = OptionFont(0).Font Then
  595.       OptionFont(0) = True
  596.     ElseIf f = OptionFont(1).Font Then
  597.       OptionFont(1) = True
  598.     ElseIf f = OptionFont(2).Font Then
  599.       OptionFont(2) = True
  600.     End If
  601.   End With
  602. End Sub
  603. Private Sub OptionFont_Click(Index As Integer)
  604.   FontNum = Index
  605. End Sub
  606. Private Sub OptionPicture_Click(Index As Integer)
  607.   PicNum = Index
  608. End Sub
  609.